/**
 * Created by Administrator on 2017/3/21.
 */
import React, { Component,Fragment } from 'react';
import {
  Form,
  Button,
  Badge,
  Select,
  DatePicker,
  Radio,
  Descriptions,
  Input,
  Typography,
  Icon,
  Upload,
  Modal, Col,
} from 'antd';
import request from '@/utils/request';
import { connect } from 'dva';
import moment from 'moment';
import FullCalendar from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin, { Draggable } from '@fullcalendar/interaction';
import '@fullcalendar/core/main.css';
import '@fullcalendar/daygrid/main.css';
import '@fullcalendar/timegrid/main.css';
import BuildModalTitle from '@/components/BuildModalTitle';

import { afterCloseModal, leaveStatue,leaveStatueImg } from '@/utils/utils';
import config from '@/config/config';
import ZImg from 'react-zmage';
import AddOrEditReserve2 from '../CarInfo/addOrEditReserve2';
const { confirm } = Modal;
const { Paragraph } = Typography;
const { TextArea } = Input;
const { Option } = Select;

const ButtonGroup = Button.Group;

class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
      fileList: [],
      all_users: [],
      format: 'YYYY-MM-DD',
    };
    this.myRef = React.createRef();
  }

  render() {
    const { getFieldDecorator } = this.props.form;
    const editRecord = this.props.editRecord;

    const that=this
    return (
      <div>
        <Form>
          <Descriptions className={'blue-descriptions'} title={''}
                        bordered  column={2}   >
            <Descriptions.Item label="操作人">
              {this.props.editRecord.user.name}
            </Descriptions.Item>
            <Descriptions.Item label="状态">
              {
                this.props.editRecord.status===2&&
                <div className='fc-event'
                     style={{  background: '#cf3b00', color: '#fff', padding: '5px' }}>已预订
                </div>
              }
              {
                this.props.editRecord.status===3&& <div className='fc-event'
                   style={{background: '#6d6d6d', color: '#fff', padding: '5px' }}>不可用
              </div>
              }
              {
                this.props.editRecord.status === 1 && <div className='fc-event'
                                                           style={{
                                                             marginBottom: '8px',
                                                             background: '#00c10b',
                                                             color: '#fff',
                                                             padding: '5px'
                                                           }}>可预订
                </div>
              }
            </Descriptions.Item>
            <Descriptions.Item label="开始时间">
              {this.props.editRecord.start_time}
            </Descriptions.Item>
            <Descriptions.Item label="结束时间">
              {this.props.editRecord.end_time}
            </Descriptions.Item>
            <Descriptions.Item label="事由" span={2} style={{ whiteSpace: 'wrap' }}>
              <Paragraph style={{ fontWeight: 'bold', color: '#000' }} ellipsis={{ rows: 3, expandable: true }}>
                {this.props.editRecord.remark}
              </Paragraph>
            </Descriptions.Item>
          </Descriptions>
        </Form>
      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);


